<?php
    include_once './common.php';
     $sql = "SELECT * FROM goods";
     $res =  mysqli_query($link,$sql);
     $arr = array();
     while($one = mysqli_fetch_assoc($res)){
       $arr[] = $one;
     }
    echo json_encode($arr);//数据库

?>